package cn.com.api.mapper.base;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import cn.com.api.entity.ApiT_dingass;

//DAO
public interface T_dingassMapperBase {

	// 根据id查看
	@Select("SELECT * FROM t_dingass  WHERE id = #{id}")
	public ApiT_dingass findT_dingassById(Integer id);

	// 查看数据集
	@Select("SELECT * FROM T_dingass")
	public List<ApiT_dingass> findT_dingasss();

	// 添加
	@Insert("INSERT INTO t_dingass (did, rid, money, num, product_id) VALUES (#{did}, #{rid}, #{money}, #{num}, #{product_id})")
	@Options(useGeneratedKeys = true, keyProperty = "id")
	public int insertT_dingass(ApiT_dingass t_dingass);

	// 修改
	@Update("UPDATE t_dingass SET did = #{did}, rid = #{rid}, money = #{money}, num = #{num}, product_id = #{product_id} WHERE id = #{id}")
	public int updateT_dingass(ApiT_dingass t_dingass);

	// 删除
	@Delete("DELETE FROM t_dingass  WHERE id = #{id}")
	public int deleteT_dingass(Integer id);

}
